﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ClassEvalTerm.aspx.cs" Inherits="Moral_Teacher_Reprots_ClassEvalTerm" %>

<%@ Register Src="../../../Custom/SchoolYear.ascx" TagName="SchoolYear" TagPrefix="uc1" %>
<%@ Register Src="../../../Custom/SchoolGrade.ascx" TagName="SchoolGrade" TagPrefix="uc2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../../Common/css/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../../Common/js/TableForExport.js"></script>
    <script language="javascript">
        function show()
        {
            currentindex = null;
            currentasc = false;
            document.getElementById("schoolYear").value = GetCurrentYear;
            document.getElementById("schoolTerm").value = GetCurrentTerm;

            document.getElementById("schoolGrade").value = GetCurrentGrade;
            document.getElementById("btnBind").click();
        }
        var currObj = null;
        var currentindex = null;
        var currentasc = false;
        function SetHightLight(obj)
        {
            if(obj!=null)
            {
                if(currObj!=null)
                {
                    currObj.style.backgroundColor = "#ffffff";
                }
                obj.style.backgroundColor = "#fffccf";
                currObj = obj;
            }
        }
        function sort(index )
        {
            if(currentindex == null)
            {

                currentindex = 0;
                for(var col=0;col<document.getElementById("settingTable").rows[0].cells.length;col++)
                {
                    currentindex += parseInt( document.getElementById("settingTable").rows[0].cells[col].colSpan);
                }
                currentindex =currentindex-1;
//                currentindex = document.getElementById("settingTable").rows[0].cells.length-1;
            }
            if(currentindex == index)
            {
                currentasc = !currentasc;
                var objs = document.getElementById("img"+index).getElementsByTagName('img');
                if(objs != null && objs.length > 0)
                {
                    var obj = objs[0];
                    if(!currentasc)
                    {
                        obj.src = "../../Common/images/1.gif";
                    }
                    else
                    {
                        obj.src = "../../Common/images/2.gif";
                    }
                }
                SortTableCell(document.getElementById("settingTable"),currentindex,currentasc,2,0);
            }
            else
            {
                var str = document.getElementById("img"+currentindex).innerHTML;
                document.getElementById("img"+index).innerHTML=str;
                document.getElementById("img"+currentindex).innerHTML="";
                currentindex = index;
                SortTableCell(document.getElementById("settingTable"),currentindex,false,2,0);
            }
        }
        
        function getExcel()
        {
            var cells = GetTableInfo(document.getElementById("settingTable"));
            if(cells!=null)
            {
                PageMethods.GetExcel(cells,function(result){
                document.getElementById('downloadf').src = "";
                document.getElementById('downloadf').src = "../../../PostFileBytes.aspx";

                },function(err){alert(err._message);});
            }
            
        }
    </script>
</head>
<body  SCROLL="no">
<form id="form1" runat="server">
            <div class="pageBody">
            <div class="mainWarp" style="height:85%;padding-top:5px;padding-left:5px;" >
                <table >
                <tr>
                <td  style="padding-left:4px;">
                    学年学期：<uc1:SchoolYear ID="SchoolYear1" runat="server" />
                    &nbsp;</td>
                <td  style="padding-left:4px;">
                    <uc2:SchoolGrade ID="SchoolGrade1" runat="server" />
                    &nbsp;</td>
                <td style="padding-left:10px;">
                   <input id="Button1" type="button" value="查询" class="commonBut" style="display:block;"   onclick="show()"/>
                </td>
                
                <td style="padding-left:10px;">
                   <input id="Button2" type="button" value="导出Excel" class="commonBut"  style="display:block;" onclick="getExcel()" />
                </td>
                </tr>
                </table><div>
                    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
                    </asp:ScriptManager>
                </div>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:Repeater ID="Repeater1" runat="server">
                            <HeaderTemplate>
                            <div style="overflow-y:auto;overflow-x:none;height:98%;">
                                <table id="settingTable" border="0" cellpadding="0" cellspacing="1"  style="width:1000px;" class="useList1">
                                    <%= GetHeader() %>
                                </HeaderTemplate>
                                <ItemTemplate>
                                <%# GetTeacher(Convert.ToInt32(Eval("RID")), Eval("ClsName").ToString())%>
                                       
                                </ItemTemplate>
                                <FooterTemplate>
                                </table></div>
                            </FooterTemplate>
                        </asp:Repeater>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnBind" EventName="Click" />
                    </Triggers>
                </asp:UpdatePanel>
                <div style="display: none;">
                  <asp:Button ID="btnBind" runat="server" OnClick="btnBind_Click" Text="btnBind"  />
                    <asp:TextBox ID="schoolYear" runat="server"></asp:TextBox>
                    <asp:TextBox ID="schoolTerm" runat="server"></asp:TextBox>
                    <asp:TextBox ID="year" runat="server"></asp:TextBox>
                    <asp:TextBox ID="yearmonth" runat="server"></asp:TextBox>
                    <asp:TextBox ID="schoolGrade" runat="server"></asp:TextBox>
                </div>

            </div>
        </div>       
    </form>
    <div id="upInputPop" class="layoutWarp" style="display: none">
        <iframe src="" name="downloadf" id="downloadf" style="height: 80%;width: 95%;overflow-y:auto;overflow-x:none;" frameborder="0"   ></iframe>
    </div>
</body>
</html>
<script language="javascript">show();</script>